#include <string>
#include <unordered_set>
#include <vector>

using namespace std;

class Solution {
public:
    string destCity(vector<vector<string>>& paths) {
        unordered_set<string> set;
        for (vector<string>& path : paths) {
            set.insert(path[0]);
        }
        for (vector<string>& path : paths) {
            if (set.find(path[1]) == set.end()) {
                return path[1];
            }
        }
        return "";
    }
};

